package ncu.me.musicplayer.entity;

import androidx.annotation.Nullable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Unique;
import org.greenrobot.greendao.annotation.Generated;
import org.jetbrains.annotations.PropertyKey;

import java.util.Date;
import java.util.HashMap;

/**
 * @Author ye
 * @Date 2020/6/2 20:17
 * @Version 1.0
 */
@Entity
public class SearchItem {
    @Id(autoincrement = true)
    Long id;
    @Unique
    private String key;
    private long time;


    @Generated(hash = 589403957)
    public SearchItem(Long id, String key, long time) {
        this.id = id;
        this.key = key;
        this.time = time;
    }


    @Generated(hash = 1717446595)
    public SearchItem() {
    }


    @Override
    public boolean equals(@Nullable Object obj) {
        if (key == null){
            return false;
        }
        if (obj instanceof MusicInfo){
            return this.key.equals(((MusicInfo) obj).mid);
        }
        return false;
    }


    public Long getId() {
        return this.id;
    }


    public void setId(Long id) {
        this.id = id;
    }


    public String getKey() {
        return this.key;
    }


    public void setKey(String key) {
        this.key = key;
    }


    public long getTime() {
        return this.time;
    }


    public void setTime(long time) {
        this.time = time;
    }

}
